Skip to content

Add support for LLM routing using developer preferences #6075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

adilhafeez
Copy link

@adilhafeez adilhafeez commented Jul 22, 2025

Related GitHub Issue

Closes: #5362

Roo Code Task Context (Optional)

Description

This change adds support for archgw router. This gateway allows developers to choose between models based on developer preferences.

This PR is influenced from Lite-LLM PR #3242

image

Test Procedure

  1. Ensure that you have installed pre-requisites
  2. Start archgw with preference_based_routing demo
$ cd demos/use_cases/preference_based_routing
$ archgw up --service archgw --foreground

2025-07-22 12:29:00,763 - cli.main - INFO - Starting archgw cli version: 0.3.5
2025-07-22 12:29:00,763 - cli.main - INFO - Validating /Users/adilhafeez/src/intelligent-prompt-gateway/demos/use_cases/preference_based_routing/arch_config.yaml
2025-07-22 12:29:01,845 - cli.core - INFO - Starting arch gateway, image name: archgw, tag: katanemo/archgw:0.3.5
...
[2025-07-22 19:29:05.909][66][debug][wasm] [source/extensions/common/wasm/wasm.cc:100] Thread-Local Wasm created 24 now active
  1. In providers select "Arch LLM Gateway"
  2. Select "use preference based routing" option and use following configuration for routing. Note: model name must match with model names listed in arch_config.yaml.
  - model: openai/gpt-4o
    routing_preferences:
      - name: code understanding
        description: understand and explain code

  - model: openai/gpt-4.1
    routing_preferences:
      - name: code generation
        description: generating new code

At this point you are ready. Fire away your queries and see arch router use dynamic models based on query type.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Video screenshot - reddit post

Documentation Updates

Does this PR necessitate updates to user-facing documentation?

  • No documentation updates are required.
  • Yes, documentation updates are required. (Please describe what needs to be updated or link to a PR in the docs repository).

RooCodeInc/Roo-Code-Docs#262

Additional Notes

  • API Key requirement: Right now API Key is required in this code change which is not required for arch gateway. But I am not able to make it optional. When I make it optional I cannot get past welcome screen. I do need some help here on how to make the api key optional so that I can get past welcome screen.

Get in Touch

@mrubens


Important

Adds support for ArchGW routing using developer preferences, including YAML validation and tests.

  • Behavior:
    • Adds support for archgw routing using developer preferences in validate.ts.
    • Introduces validateArchGwPreferenceConfig() for YAML validation of routing preferences.
  • Validation:
    • Updates validateModelId() and getModelIdForProvider() to include archgw.
    • Adds archgw to validateModelsAndKeysProvided() for API key validation.
  • Tests:
    • Adds tests for archgw model validation in validate.test.ts.
    • Tests validateArchGwPreferenceConfig() for YAML schema validation.
  • Misc:
    • Updates i18n files for new validation messages related to archgw.

This description was created by Ellipsis for 4ad271f. You can customize this summary. It will automatically update as commits are pushed.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 22, 2025
@adilhafeez adilhafeez marked this pull request as ready for review July 22, 2025 23:29
@adilhafeez adilhafeez requested review from mrubens, cte and jr as code owners July 22, 2025 23:29
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Jul 22, 2025
@adilhafeez
Copy link
Author

ping @mrubens

@mrubens
Copy link
Collaborator

mrubens commented Jul 23, 2025

Thanks, will look soon!

@mrubens
Copy link
Collaborator

mrubens commented Jul 23, 2025

Hey @daniel-lxs I’ve been talking to them about this one - will take a look tonight.

@mrubens mrubens reopened this Jul 23, 2025
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Jul 23, 2025
@github-project-automation github-project-automation bot moved this from Done to Triage in Roo Code Roadmap Jul 23, 2025
"archgwPreferenceConfigDesc": "確保模型 ID 存在於您的 arch gateway 配置中。",
"invalidRoutingConfig": "無效的路由配置格式。",
"routingConfig": "路由配置",
"usePreferenceBasedRouting": "使用基于偏好的路由",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical consistency: The value for "usePreferenceBasedRouting" uses simplified Chinese character '基于'. For consistency with other entries which use Traditional Chinese (e.g., '基於'), this should be updated to "使用基於偏好的路由".

Suggested change
"usePreferenceBasedRouting": "使用基于偏好的路由",
"usePreferenceBasedRouting": "使用基於偏好的路由",

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

@daniel-lxs daniel-lxs moved this from Triage to Issue [In Progress] in Roo Code Roadmap Jul 24, 2025
@daniel-lxs daniel-lxs moved this from Issue [In Progress] to PR [Draft / In Progress] in Roo Code Roadmap Jul 24, 2025
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request PR - Draft / In Progress size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: PR [Draft / In Progress]
Development

Successfully merging this pull request may close these issues.

Add support for LLM routing using developer preferences
4 participants